WEBVTT

00:00.890 --> 00:05.960
Welcome to step two of our solution and here we are asked to create an appropriate index from nineteen

00:05.960 --> 00:10.010
hundred and ninety seven until the end of the year 2008.

00:10.130 --> 00:16.700
That best reflects the marriage strategy and to create a normalized price chart and we should get here

00:16.730 --> 00:19.490
the stock price data from Yahoo Finance.

00:19.700 --> 00:22.860
And let's have a look here again at the case.

00:23.030 --> 00:30.560
So Marriott's is invested in the five most valuable health care stocks and her strategy is pretty simple.

00:30.560 --> 00:35.280
She buys an equal number of shares of each stock and reinvest all dividends.

00:35.480 --> 00:39.930
And we should create an index that best reflects strategy here.

00:40.010 --> 00:47.800
And in this case that's a price weighted Performance Index in Step one we identify to the stock take

00:47.800 --> 00:49.900
us for our five companies.

00:49.900 --> 00:57.510
And here we have the US and now we should download historical price data from nineteen hundred ninety

00:57.510 --> 00:58.380
seven.

00:58.540 --> 01:05.860
So including the very last day of nineteen hundred ninety six until the end of 2018 and therefore we

01:05.860 --> 01:13.390
create here two variables start and end with the respective dates and with the by finance library and

01:13.390 --> 01:20.230
the download method we can actually download the historical price data and we pass here the tick our

01:20.240 --> 01:26.620
list and the start and the end date and for our price where the performance index we are interested

01:26.620 --> 01:33.550
in the columns the adjusted close and close and we save the data frame and the web of stocks

01:39.090 --> 01:46.080
so that's uh the adjusted close and the close price for five stocks here beginning from the very last

01:46.080 --> 01:48.410
day of nineteen hundred ninety six.

01:48.450 --> 01:55.730
So typically here the download method of the finance library if you determine here the start date first

01:55.740 --> 01:58.490
of January nineteen hundred ninety seven.

01:58.590 --> 02:05.280
Then typically we get also the immediately preceding day or year the thirty first of December nineteen

02:05.280 --> 02:07.000
hundred ninety six.

02:07.140 --> 02:13.180
And our task is now to create a price weighted Performance Index and this can be done in few steps.

02:13.200 --> 02:19.470
So first of all we have to calculate the weights of the constituents over time and we have to define

02:19.470 --> 02:23.510
the weights with the closing prices and then we have to wait.

02:23.510 --> 02:29.430
The daily returns based on the adjusted close prices with the weights that we derived in the first step

02:29.850 --> 02:35.910
and by doing so we have the daily returns of our new index and as assets that we have to calculate the

02:35.910 --> 02:42.570
cumulative investment multiple on each timestamp and calculate the index values also in each timestamp

02:42.870 --> 02:53.930
based on a base value of 100 so let's start with the weights and we select the close prices and for

02:53.930 --> 03:00.830
each and every time stand by for each and every row we divide each element and that row by the respective

03:00.920 --> 03:06.650
some of the row and we safe actually hear the new resulting data frame and the variable weights.

03:07.040 --> 03:13.630
And let's overlook so that's the respect for weights based on a price weighted strategy.

03:14.230 --> 03:19.690
And initially in nineteen hundred ninety seven we can see that the highest weights we have for Mark

03:20.380 --> 03:24.260
and let's go down here to 2000 and eighteen.

03:24.320 --> 03:32.720
And we can see that we have the highest rates of 43 percent for the United test group actually.

03:32.740 --> 03:33.430
So here

03:41.450 --> 03:46.380
so that's the debates of our constituents over time and our new index.

03:46.380 --> 03:52.810
And now in the next step we calculate the arc rate a return state of frame and therefore we choose that

03:52.810 --> 03:59.930
the adjusted close prices to calculate the total return based on the assumption that the dividends will

03:59.930 --> 04:06.400
be reinvested into the index and we calculate the daily return with uh the percentage change method.

04:06.410 --> 04:10.230
And of course we also change the drop and a method.

04:10.760 --> 04:14.720
So that's the return data frame and then the next step.

04:14.720 --> 04:21.560
We calculate the daily returns of our index by evading the daily returns of the constituents with their

04:21.560 --> 04:25.970
respective weights at the immediately preceding timestamp.

04:25.970 --> 04:28.160
So that's what we are doing here.

04:28.190 --> 04:35.870
And finally we calculate for each and every timestamp the cumulative investment multiple by adding 1

04:36.320 --> 04:39.710
and using the Camp Road method here.

04:39.710 --> 04:47.180
And finally as our base where you should be 100 we multiply each and every cumulative investment multiple

04:47.180 --> 04:56.320
with 100 and we save our resulting index in the variable health index and let's have a look here.

04:56.320 --> 05:02.400
So here we have a panel series with a index value of ninety nine point eight.

05:02.590 --> 05:06.190
At the second of January nineteen hundred ninety seven.

05:06.250 --> 05:10.470
So the first of January is a bank holiday so we do not have any values here.

05:11.080 --> 05:17.170
And finally we should determine that on the very last timestamp all day of the year nineteen hundred

05:17.170 --> 05:25.450
nineteen six we have the base value of one hundred and therefore we create here a timestamp for the

05:25.480 --> 05:31.770
thirty first of December nineteen hundred ninety six and we actually create a new element for our as

05:31.780 --> 05:39.080
serious here and we assign the value of one hundred and let's have again a look.

05:39.100 --> 05:41.560
So here we cannot see the timestamp.

05:41.590 --> 05:47.260
Thirty first of December nineteen hundred ninety six because it's still not sorted so here it's at the

05:47.260 --> 05:52.340
very end and therefore in a next step we have to start the index.

05:52.490 --> 06:00.600
And also here we pass true to the in-place parameter and we also assign a name to our panda series.

06:00.620 --> 06:04.260
So that's the health care index.

06:04.260 --> 06:05.700
And let's have a final look here.

06:06.480 --> 06:14.220
So that's our large cap health care index that best reflects marries investment strategy starting with

06:14.220 --> 06:19.350
a base value of 100 at the very last day of nineteen hundred ninety six.

06:19.350 --> 06:25.830
And finally we end up here at the end of 2018 at eight hundred ninety.

06:25.860 --> 06:28.170
So that's quite amazing actually.

06:28.230 --> 06:34.590
And we can also plot here the evolution of the price of our index with the plot method

06:38.930 --> 06:42.690
and we can see that from an initial base value of 100.

06:42.860 --> 06:49.160
Mary could manage to increase her investment to a value of almost a 900.

06:49.460 --> 06:56.450
So that's a pretty terrific year because our initial investment increased eight fold are almost nine

06:56.450 --> 06:59.390
fold in only twenty two years.

06:59.390 --> 07:05.660
So that was a very first analysis of our investment strategy and we will continue to do so in the next

07:05.660 --> 07:06.030
video.

07:06.030 --> 07:07.460
So I hope to see it there by.
